|
"Hello, World!" report Thus, we create a new report in Delphi by selecting the "File|New" application. We put the "TfrxReport" component from FastReport component palette on the project form. This is all we would need to create our first report. The report will contain one inscription only ("Hello, World!"). Open the designer by doubleclicking on the "TfrxReport" component (otherwise you can select the "Design Report..." item in the component pop-up menu). After that, click the "Text" button in the "Objects" designer panel. Move the mouse cursor to the necessary place on the page, and click again. The object thus has been inserted.
The text editor window will be displayed right away; if it does not appear (this can be set in the designer settings), then doubleclick the object. Enter the "Hello, World!" text, and then cli ck the "خت" button.
We have done all the work in Delphi IDE without writing a code line. If a user wishes to start a project, one would need to add some things. Create a button on the project form, and then write the following in its handler: frxReport1.ShowReport; Thus, as soon as your application is activated, the report will be built and displayed as soon as you click on this button. Let us complicate our first report a little. Let the text ("Hello, World!") be displayed in bold letters with yellow background and a frame. Also let us make the current date to be displayed next to the text. Once again, open FastReport, and select an object with a text with the help of the mouse. Note that some buttons on toolbars become active. Find the "Bold" button in the
"Text" toolbar, and click on it. To enable the frame, click on "All frame lines". If necessary, some frame lines can be disabled by using The easiest way to display a date is to use the "System text" object. We add it to the page in exactly the same way as we have done it with the first object. Then we select "System variable" in the editor window and "[DATE]" in the dropped list below.
Close the editor by pressing the "OK" button, and start the report to see the result.
|